<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="statics/js/jquery-1.12.4.js"
	charset="UTF-8"></script>
<link rel="stylesheet" href="statics/css/manage.css" type="text/css"></link>
<script src="statics/js/usermanage.js"></script>
<script type="text/javascript"
	src="statics/js/script/jquery.pagination.js" charset="UTF-8"></script>
<title>Insert title here</title>
<style type="text/css">
.xgmc {
	margin: 30px 85px;
}

.mcs {
	margin: 20px 85px;
}

a.x {
	margin-top: 3px;
}

button.btn {
	margin-left: 150px;
}
</style>
<script type="text/javascript">
	function carattrvalmodify(n, i, e) {
		tanchu(n, i);
		$.post("carattrval", function(data) {
			$.each(data, function(i, item) {
				if (e.id == data[i].caId) {
					$("#a1").attr("value", data[i].caName);
					$("#caId").attr("value", data[i].caId);
					$("#csId").attr("value", data[i].csId);
				}
			});
		})
	}
	$(function(){
		$('.leibiao').on('click','#tianjia',function(){
			$('.box').css('display','block');
			$('.pan').val('添加');
			$("#a1").attr("value", "");
			$("#csId").attr("value", $(this).attr('data-csid'));
		})
	})
</script>
<style type="text/css">
.dd {
	width: 200px;
	height: 50px;
}
</style>
</head>
<body>
	<form method="post" class="leibiao">
		<a class="blueadd" id="delete" onclick="deletesome(5)">-删除</a> <a
			class="blueadd" id="tianjia" data-csid="${csid }" onclick="carattrvalmodify2(1,1)">+添加</a>
		<div class="dd"></div>
		<table>
			<thead>
				<tr>
					<th><input type="checkbox" onchange="checkAll(this)"></th>
					<th>名称</th>
					<th>操作</th>
				</tr>
			</thead>

			<tbody>

				<c:forEach items="${carattrval }" var="cv">
					<tr>
						<td><input type="checkbox" id="${cv.caId}" onchange="check()"></td>
						<td>${cv.caName}</td>
						<td><div class="caozuo">
								<a class="red" onclick="carattrvalmodify(1,1,this)"
									id=${cv.caId }>修改</a>
							</div></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</form>

	<div class="box">
		<a class="x" onclick="carattrvalmodify(0,1,this)"> 
		<img width="40px" height="30px" src="statics/image/yqs/close.png">
		</a>
		<form action="carmodify?pid=3" method="post">
			<div class="mcs">
				<span>名称:</span>
				<input type="text" name="name" id="a1">
			</div>
			<input type="hidden" name="caId" id="caId"> 
			<input type="hidden" name="csId" id="csId">
			<input type="text" name="pan" class="pan" value="" style="display: none;">
			<button class="btn">确定</button>
		</form>
	</div>


	<div id="temp"></div>
</body>
</html>